﻿using System;
using System.Collections.Generic;
using System.Text;

using Asp = System.Web;

namespace Hanhud.Web.UI
{
    public class HANHUDFooter : Asp.UI.Control, IHANHUDFooter
    {
        public System.Web.UI.Control ThisControl
        {
            get { return this; }
        }

        private string _footerContent = null;

        public HANHUDFooter()
        {
            this.Load += new EventHandler(HANHUDFooter_Load);
        }

        void HANHUDFooter_Load(object sender, EventArgs e)
        {
            _footerContent = CWeb.GetFooter();
        }

        protected override void Render(Asp.UI.HtmlTextWriter writer)
        {
            //base.Render(writer);
            writer.WriteLine(@"
                <!-- Begin footer -->
                <div style=""margin: 0; height: 7px; background: red;""></div>
                <div class=""Footer"">
                    <div style=""padding: 5px;"">");
            writer.Write(_footerContent);
            writer.Write(@"
                    </div>
                </div>
                <!-- End footer -->
            ");
        }
    }
}